d->shared_info = (void *)alloc_xenheap_page();
memset(d->shared_info, 0, PAGE_SIZE);
- d->shared_info->arch.mfn_to_pfn_start =
- virt_to_phys(&machine_to_phys_mapping[0])>>PAGE_SHIFT;
+ ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid];
+ d->shared_info->arch.mfn_to_pfn_start = m2p_start_mfn;
SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d);
machine_to_phys_mapping[virt_to_phys(d->shared_info) >>
PAGE_SHIFT] = INVALID_P2M_ENTRY;
* contiguous (or near contiguous) physical memory.
*/
#undef machine_to_phys_mapping
+
+/*
+ * The phys_to_machine_mapping is the reversed mapping of MPT for full
+ * virtualization.
+ */
+#undef phys_to_machine_mapping
+
#ifdef __x86_64__
extern unsigned long *machine_to_phys_mapping;
+extern unsigned long *phys_to_machine_mapping;
#else
+ /* Don't call virt_to_phys on this: it isn't direct mapped. Using
+ m2p_start_mfn instead. */
#define machine_to_phys_mapping ((unsigned long *)RDWR_MPT_VIRT_START)
+ extern unsigned long m2p_start_mfn;
+#define phys_to_machine_mapping ((unsigned long *)PERDOMAIN_VIRT_START)
#endif
#define DEFAULT_GDT_ENTRIES (LAST_RESERVED_GDT_ENTRY+1)